package org.example.word;


import org.example.word.pojo.AdaptApplicationForm;
import org.example.word.pojo.TestApplicationForm;
import org.example.word.pojo.TestProgressFrom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/api/word")
public class WordParseController {

    @Autowired
    private WordTableParserService parserService;

    @PostMapping("/parse")
    public ResponseEntity<?> parse(
            @RequestParam("file") MultipartFile file,
            @RequestParam("type") WordTableParserService.ParseType type
    ) throws Exception {
        return ResponseEntity.ok(parserService.parse(file.getInputStream(), type));
    }
}